/*
 *  This file is part of Moeditor.
 *
 *  Copyright (c) 2016 Menci <huanghaorui301@gmail.com>
 *  Copyright (c) 2016 Wamadahama
 *
 *  Moeditor is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Moeditor is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Moeditor. If not, see <http://www.gnu.org/licenses/>.
 */

:root{
    --spaceX: 45px;
    --spaceY: 30px;
}

html[lang="zh_CN"] body[settings-editor-font="default"] {
    --body-font: 'Roboto Mono', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Liberation Mono', 'Dejavu Mans Mono', monospace, 'Noto Sans CJK SC', 'Source Han Sans SC', 'Microsoft Yahei';
}

body[settings-editor-font="default"] {
    --body-font: '';
}

body[settings-editor-font="monospace"] {
    --body-font: monospace;
}

body[settings-editor-font="serif"] {
    --body-font: serif;
}

body[settings-editor-font="sans"] {
    --body-font: sans-serif;
}

body[settings-editor-font="SansPro"] {
    --body-font: 'source-sans-pro';
}

body[settings-editor-font="Merriweather"] {
    --body-font: 'Merriweather';
}


.notransition, .notransition *:not(.transition):not(.CodeMirror-cursors):not(.CodeMirror-lines):not(.CodeMirror-sizer):not(.CodeMirror-vscrollbar) {
    transition: none !important;
}

/* Specail Transition Class  */

.CodeMirror-sizer {
    transition: none !important;
    transition: margin-left .5s !important;
}

html {
    margin: 0 !important;
    padding: 0 !important;
    width: calc(100% - 2px) !important;
    height: calc(100% - 2px) !important;
    overflow: hidden !important;
    -webkit-user-select: none !important;
    border: 1px solid #d2d2d2 !important;
}

body{
    background: #fff !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    -webkit-user-select: none !important;
    cursor: default !important;
    width: 100% !important;
    height: 100% !important;
}

#side-menu {
    width: 300px;
    margin-left: -301px;
    height: calc(100% - 67px);
    background: #fafafa;
    transition: all 200ms ease-in-out;
    padding-top: 20px;
    padding-bottom: 45px;
    cursor: default;
    z-index: 1;
    position: absolute;
    border-right: 1px solid #d2d2d2;
}

#side-menu #logo {
    font-family: Raleway;
    font-size: 35px;
    font-weight: lighter;
    letter-spacing: 5px;
    text-align: center;
    color: #666;
    border-bottom: 1px solid #ececec;
    padding-bottom: 15px;
}

#side-menu ul {
    margin-top: 10px;
    padding: 0;
    color: #444;
    font-size: 14px;
    letter-spacing: 1px;
}

#side-menu li {
    font-family: Roboto, Helvetica, 'Segoe UI', Arial, sans-serif;;
    list-style-type: none;
    height: 40px;
    line-height: 40px;
    padding-left: 30px;
    text-align: left;
    vertical-align: middle;
}

#side-menu li:hover {
    background-color: rgb(236, 236, 236);
}

#side-menu li:active {
    background-color: rgb(222, 222, 222);
}

#side-menu li.break {
    height: 10px;
    pointer-events: none;
    border-bottom: 1px solid #ececec;
    margin-bottom: 10px;
}

#side-menu-cover, #file-tree-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1000001;
    background: rgba(77, 77, 77, 0.2);
    transition: all 500ms ease-in-out;
    pointer-events: none;
    opacity: 0;
}

#main {
    transition: all 500ms ease-in-out;
    position: fixed !important;
    left: 1px !important;
    top: 1px !important;
    width: calc(100% - 2px) !important;
    height: calc(100% - 2px) !important;
    overflow: hidden !important;
}

#main-container {
    height: calc(100% - 25px);
}

#left-panel {
    position: absolute;
    left: 0;
    width: 50%;
    height: calc(100% - 25px);
    transition: all 500ms ease-in-out;
}

#right-panel {
    position: absolute;
    right: 0;
    width: 50%;
    overflow: hidden;
    height: calc(100% - 25px);
    transition: all 500ms ease-in-out;
}

.read #left-panel {
    left: -50%;
    width: 50%;
}

.read #right-panel {
    width: 100%;
}

.read #right-panel .cover-top {
    left: 0;
    width: calc(100% - 10px);
}

.write #left-panel {
    width: 100%;
}

.read #left-panel .cover-top {
    width: calc(100% - 10px);
}

.write #right-panel {
    right: -50%;
    width: 50%;
}




#editor.focus .CodeMirror-line {
    transition: opacity 150ms !important;
    opacity: 0.3;
}

#editor.focus .CodeMirror-activeline .CodeMirror-line {
    opacity: 1;
}

.CodeMirror-activeline-background { background: none; }

#editor textarea {
    width: 0;
    height: 0;
    border: 0;
    margin: 0;
    padding: 0;
}

.cover {
    position: absolute;
    pointer-events: none;
    top: 0;
    width: 50%;
    height: 100%;
    cursor: default;
    z-index: 1000;
}

.cover-top {
    position: absolute;
    top: 0;
    width: 100%;
    height: 40px;
    z-index: 1000;
}

#drag-left {
    z-index: -1;
    position: absolute;
    top: 0;
    left: 0;
    width: calc(50% - 10px);
    height: 100%;
}

#drag-right {
    z-index: -1;
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
}

#left-panel .cover-top {
    left: 1px !important;
}

#right-panel .cover-top {
    right: -1px !important;;
}

.cover-nobackground {
    background: transparent !important;
}

#cover-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25px;
    z-index: 1000;
    border-top: 1px solid rgba(128, 128, 128, 0.3);
    -webkit-app-region: no-drag;
}

#cover-bottom #cover-bottom-background-left {
    position: absolute;
    left: 0;
    width: 50%;
    height: 100%;
    transition: all 500ms ease-in-out;
}

#cover-bottom #cover-bottom-background-right {
    position: absolute;
    right: 0;
    width: 50%;
    height: 100%;
    transition: all 500ms ease-in-out;
}

.read #cover-bottom #cover-bottom-background-left {
    left: -50%;
}

.read #cover-bottom #cover-bottom-background-right {
    width: 100%;
}

.write #cover-bottom #cover-bottom-background-left {
    width: 100%;
}

.write #cover-bottom #cover-bottom-background-right {
    right: -50%;
}

#cover-bottom .button-bottom {
    display: inline-block;
    pointer-events: auto;
    color: #b3b3b3;
    font-size: 14px;
    /*margin-top: 5px;*/
    margin-left: 3px;
    margin-right: 3px;
    line-height: 2;
}

/*#editor * {
    transition: all 500ms ease-in-out;
}*/

body #editor * {
    font-family: var(--body-font),'Roboto Mono', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Liberation Mono', 'Dejavu Mans Mono', monospace !important;
}

#preview {
    position: relative !important;
    -webkit-user-select: initial;
    transition: all 500ms ease-in-out;
    width: calc(100% - var(--spaceX) * 2) !important;
    height: calc(100% - var(--spaceY)) !important;
    padding: var(--spaceY)  var(--spaceX) 0  var(--spaceX);
    overflow: scroll !important;
    font-size: 14px !important;
    outline: none;
}

@media screen and (min-width: 875px){
    .read #container {
        max-width: 1200px !important;
        width: calc(100% - 45px * 2) !important;
    }
}

#container {
    transition: all 500ms ease-in-out;
    -webkit-user-select: initial;
    margin: auto !important;
}

.cm-s-default .cm-header {
    color: inherit !important;
}

.cm-header-1 { font-size: 1.5em; }
.cm-header-2 { font-size: 1.3em; }
.cm-header-3 { font-size: 1.2em; }
.cm-header-4 { font-size: 1.1em; }
.cm-header-5 { font-size: 1.05em; }
.cm-header-6 { font-size: 1em; }

.CodeMirror-vscrollbar {
    z-index: 1000000 !important;
    position: absolute !important;
}

#preview .CodeMirror-vscrollbar,
.write .CodeMirror-vscrollbar {
    position: absolute !important;
}

.CodeMirror {
    font-size: 14px;
}

.CodeMirror-cursors {
    transition: opacity 500ms ease-in-out !important;
}

.CodeMirror-cursors[style="visibility: hidden;"] {
    opacity: 0 !important;
    visibility: visible !important;
}

.CodeMirror-lines {
    overflow-x: visible;
}

#left-panel{
    overflow: hidden!important;
}

#editor {
    position: relative  !important;
    overflow: visible  !important;
    -webkit-user-select: initial;
    transition: all 500ms ease-in-out;
    width: calc(100% - var(--spaceX) * 2)  !important;
    height: 100%  !important;
    padding: 0 var(--spaceX) 0 var(--spaceX)  !important;
}

#editor .CodeMirror {
    position: absolute !important;
    overflow: visible  !important;
    width: calc(100% - var(--spaceX) * 2) !important;
    height: calc(100% - var(--spaceY)) !important;
    padding-top: var(--spaceY)  !important;
}

#editor .CodeMirror .CodeMirror-vscrollbar {
    position: absolute;
    overflow-y: scroll;
    transition: all 500ms ease-in-out;
    right: calc(0px - var(--spaceX));
}

moemark-linenumber{
    word-wrap: break-word !important;
}


#renameForm input {
    background-color: #fff;
    border: 1px solid #ddd;
    outline: none;
    height: 30px;
    width: 100%;
    font-family: Roboto, Helvetica, 'Segoe UI', Arial, sans-serif;
    color: #666;
    box-sizing: border-box;
    padding: 5px;
}

#renameForm input::-webkit-input-placeholder{
    color: #ccc;
}

#renameForm input:hover,
#renameForm input:active {
    border: 1px solid #bbb;
}

#renameForm div.button{
    display: flex;
}
#renameForm button {
    background: #fff;
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    height: 30px;
    margin: 25px 18px;
    font-size: 22px;
    line-height: 28px;
    outline: none;
}

#renameForm .button-check{
    color: #61b56a;
}
#renameForm .button-close{
    color: #ff4a4a;
}

html.darwin #renameForm  input {
    padding-left: 7px;
    border-radius: 5px;
}

.renameForm {
    position: fixed;
    z-index: 1000;
    width: 250px;
    height: 80px;
    transition: transform .3s ease;
    font-size: 14px;
    font-family: Roboto, Helvetica, 'Segoe UI', Arial, sans-serif;
    padding: 30px;
    background-color: #f7f7f7;
    box-shadow: 0px 1px 11px -4px black;
    border-radius: 13px;
    left: 50%;
    top: 100%;
    opacity: 0;
    transform: translateX(-50%) translateY(0%);
}

.renameForm.show{
    top: 50%;
    opacity: 1;
    transform: translateX(-50%) translateY(-50%);
}

body[settings-mode=read] #drag-left, body[settings-mode=write] #drag-left {
    width: calc(100% - 6px);
}

body[settings-mode=read] #drag-right, body[settings-mode=write] #drag-right {
    width: 0;
    right: 0;
}

.biu-instance {
    -webkit-app-region: no-drag;
    font-size: 14px;
    font-family: Roboto, Helvetica, 'Segoe UI', Arial, sans-serif;
    line-height: 1.4 !important;
    padding: 5px 0px 4px 0!important;
}

.biu-instance.biu-webConsole{
    -webkit-app-region: drag;
}

.biu-close{
    -webkit-app-region: no-drag;
}

.invalidFile{
    background: red;
}

.CodeMirror-gutter-wrapper {
    display: none;
}


#editor .CodeMirror-gutter-wrapper {
    display: block;
    position: absolute;
    z-index: 4;
    background: none !important;
    border: none !important;
}

#editor.gutter .CodeMirror-code {
    box-shadow: inset 3px -2px 3px #ddd;
    padding-bottom: 3px;
}

#editor.gutter .CodeMirror-code::after {
    content: "";
    position: relative;
    bottom: -3px;
    height: 4px;
    width: 100%;
    background-color: whitesmoke;
    display: block;
}
#editor .CodeMirror-linebackground {
    left: 3px;
    width: calc(100% - 7px);
}

div#cover-bottom {
    line-height: 1 !important;
}



#editor.ctrl span.cm-string.cm-url:hover {
    text-decoration: underline;
    color: blue;
    cursor: pointer;
}

#cover-bottom-tools{
    display: flex;
    width: 100%;
    height: 100%;
}


#cover-bottom-left {
    padding-left: 10px;
    z-index: 1;
}
#cover-bottom-status{
    flex: 1;
    z-index: 1;
    line-height: 25px;
    padding-left: 10px;
}
#cover-bottom-status #status-content{
    flex: 1;
    font-size: 13px;
    line-height: 25px;
    color: #808080;
    opacity: 1;
    transition: opacity 1s;
}

#cover-bottom-right {
    padding-right: 10px;
    z-index: 1;
}

#cover-bottom .button-bottom.hover {
    color: #cecece;
}

#cover-bottom .button-bottom:active {
    color: #dcdcdc;
}
